// 评论模块

import request from '@/utils/request'

// 获取所有评论
export const getAllComment = params => {
  return request({
    method: 'get',
    url: '/app/v1_0/comments',
    params
  })
}

// 点赞
export const addLikeComment = target => {
  return request({
    method: 'post',
    url: '/app/v1_0/comment/likings',
    data: {
      target
    }
  })
}

// 取消点赞
export const cancelLikeComment = target => {
  return request({
    method: 'delete',
    url: `/app/v1_0/comment/likings/${target}`
  })
}

// 发布评论
export const issueComment = data => {
  return request({
    method: 'post',
    url: '/app/v1_0/comments',
    data
  })
}
